<html>
<head><meta charset="utf-8"><title>Unsize trait · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html">Unsize trait</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="194778672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/194778672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#194778672">(Apr 21 2020 at 09:28)</a>:</h4>
<p>Who is the right person to ask about unsizing? Current implementation asserts higher-ranked obligations for Unsize to be unprovable (i.e. <code>for&lt;'a&gt; &amp;'a T: Unsize&lt;Trait+'a&gt;</code> is not provable), with a comment (made 5 years ago) about a possibility of relaxing these restrictions. Is it still relevant?</p>



<a name="194780097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/194780097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#194780097">(Apr 21 2020 at 09:42)</a>:</h4>
<p>The relevant functions are <code>assemble_candidates_for_unsizing</code> and <code>confirm_builtin_unsize_candidate</code></p>



<a name="194853038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/194853038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#194853038">(Apr 21 2020 at 19:54)</a>:</h4>
<p><span class="user-mention" data-user-id="251766">@Areredify</span> probably me and <span class="user-mention" data-user-id="119009">@eddyb</span></p>



<a name="194853060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/194853060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#194853060">(Apr 21 2020 at 19:54)</a>:</h4>
<p>I am reminded that there's a long-standing refactoring I wanted to do in rustc</p>



<a name="194853066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/194853066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#194853066">(Apr 21 2020 at 19:55)</a>:</h4>
<p>to make it's implementation less ad-hoc</p>



<a name="194853078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/194853078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#194853078">(Apr 21 2020 at 19:55)</a>:</h4>
<p>which may or may not turn out to be a breaking change</p>



<a name="194853085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/194853085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#194853085">(Apr 21 2020 at 19:55)</a>:</h4>
<p>well, it's definitely a theoretically breaking change</p>



<a name="194853101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/194853101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#194853101">(Apr 21 2020 at 19:55)</a>:</h4>
<p>if you're interested in exploring rustc, I could help mentor you through it</p>



<a name="194853118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/194853118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#194853118">(Apr 21 2020 at 19:55)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/Unsize.20trait/near/194853085" title="#narrow/stream/144729-wg-traits/topic/Unsize.20trait/near/194853085">said</a>:</p>
<blockquote>
<p>well, it's definitely a theoretically breaking change</p>
</blockquote>
<p>it may or may not affect existing crates that we know of</p>



<a name="194853142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/194853142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#194853142">(Apr 21 2020 at 19:55)</a>:</h4>
<p>Please do, I've been meaning to pick up a rustc work item</p>



<a name="194853148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/194853148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#194853148">(Apr 21 2020 at 19:55)</a>:</h4>
<p>sorry i've not been able to leave many comments etc, these last few days have had me running around a lot</p>



<a name="194853247"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/194853247" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#194853247">(Apr 21 2020 at 19:56)</a>:</h4>
<p>no worries, I have plenty other work to do</p>



<a name="195475323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/195475323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#195475323">(Apr 27 2020 at 21:08)</a>:</h4>
<p>Also ping from here, I need mentoring notes here too :P</p>



<a name="195475342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/195475342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#195475342">(Apr 27 2020 at 21:08)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="195475377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/195475377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#195475377">(Apr 27 2020 at 21:09)</a>:</h4>
<p>oh, hmm, forgot about this!</p>



<a name="195720612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/195720612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#195720612">(Apr 29 2020 at 14:48)</a>:</h4>
<p><span class="user-mention" data-user-id="251766">@Areredify</span> this rustc issue covers the refactoring I was talking about: <a href="https://github.com/rust-lang/rust/issues/50753" title="https://github.com/rust-lang/rust/issues/50753">#50753</a></p>



<a name="195726300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/195726300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#195726300">(Apr 29 2020 at 15:22)</a>:</h4>
<p>thanks, I'll look into this after finishing const stuff</p>



<a name="195738074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/195738074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#195738074">(Apr 29 2020 at 16:43)</a>:</h4>
<p><span class="user-mention" data-user-id="251766">@Areredify</span> nice -- I'm also going to open up a chalk issue about how to model the <code>Unsize</code> trait</p>



<a name="195738309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/195738309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#195738309">(Apr 29 2020 at 16:45)</a>:</h4>
<p>Is there anything special with it so modelling what rustc does is not enough/wrong? I started ti implement it a week ago and I don't think there was anything unusual with it</p>



<a name="195738399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/195738399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#195738399">(Apr 29 2020 at 16:46)</a>:</h4>
<p>the truth is that <a href="https://github.com/rust-lang/rust/issues/50753" title="https://github.com/rust-lang/rust/issues/50753">#50753</a> is mostly orthogonal</p>



<a name="195738434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/195738434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#195738434">(Apr 29 2020 at 16:46)</a>:</h4>
<p>that's about the code that decides <em>when</em> to use the <code>Unsize</code> trait</p>



<a name="195738446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/195738446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#195738446">(Apr 29 2020 at 16:46)</a>:</h4>
<p>not about the code that tests whether the <code>Unsize</code> trait applies</p>



<a name="195738501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/195738501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#195738501">(Apr 29 2020 at 16:46)</a>:</h4>
<p>I also was reading the followups from 2018 in <a href="https://github.com/rust-lang/rust/issues/50753" title="https://github.com/rust-lang/rust/issues/50753">#50753</a> -- I still think we want to make this change, but it's obviously not going to be entirely trivial and may require some tweaking</p>



<a name="195738572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/195738572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#195738572">(Apr 29 2020 at 16:47)</a>:</h4>
<p>Anyway, the only complex thing is that it involves a more involved transformation</p>



<a name="195738583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/195738583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#195738583">(Apr 29 2020 at 16:47)</a>:</h4>
<p>but yes modeling on what rustc does is precisely the right thing</p>



<a name="195738596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/195738596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#195738596">(Apr 29 2020 at 16:47)</a>:</h4>
<p>I had just planned to open an issue and offer some pointers to the relevant rustc code</p>



<a name="195738600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/195738600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#195738600">(Apr 29 2020 at 16:47)</a>:</h4>
<p>but it sounds like you already found it :)</p>



<a name="195837600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/195837600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#195837600">(Apr 30 2020 at 13:24)</a>:</h4>
<p>What's the reason behind prohibiting unsizing <code>dyn Trait + Send</code> into <code>dyn Send</code>?</p>



<a name="195849751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/195849751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#195849751">(Apr 30 2020 at 14:48)</a>:</h4>
<p>Also, what is chalks plan on returning Vtables?</p>



<a name="195976836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/195976836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#195976836">(May 01 2020 at 16:10)</a>:</h4>
<p>pr is up <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span></p>



<a name="195990609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/195990609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#195990609">(May 01 2020 at 18:06)</a>:</h4>
<p>it was way harder than I expected <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="196012754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Unsize%20trait/near/196012754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Unsize.20trait.html#196012754">(May 01 2020 at 21:35)</a>:</h4>
<p><span class="user-mention silent" data-user-id="251766">Areredify</span> <a href="#narrow/stream/144729-wg-traits/topic/Unsize.20trait/near/195849751" title="#narrow/stream/144729-wg-traits/topic/Unsize.20trait/near/195849751">said</a>:</p>
<blockquote>
<p>Also, what is chalks plan on returning Vtables?</p>
</blockquote>
<p>I don't want to return vtables ever, I want to have <code>Normalize</code> goals</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>